package com.softtown.modules.dapai.service.impl;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.softtown.common.service.impl.BaseServiceImpl;
import com.softtown.modules.dapai.dao.CompSaleDeliveryRecordsDao;
import com.softtown.modules.dapai.dto.CompMacDTO;
import com.softtown.modules.dapai.dto.CompSaleDeliveryRecordsDTO;
import com.softtown.modules.dapai.entity.CompMacEntity;
import com.softtown.modules.dapai.entity.CompSaleDeliveryRecordsEntity;
import com.softtown.modules.dapai.service.CompSaleDeliveryRecordsService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @Author: Ding Ya Yong
* @Description: 销售发货记录
* @date: 2022/1/2 11:38
* @Param:
* @return:
*/

@Service
public class CompSaleDeliveryRecordsServiceImpl extends
        BaseServiceImpl<CompSaleDeliveryRecordsDao, CompSaleDeliveryRecordsEntity> implements CompSaleDeliveryRecordsService {



    @Override
    public PageInfo<CompSaleDeliveryRecordsDTO> getSaleDeliveryRecordsPageList(CompSaleDeliveryRecordsDTO compSaleDeliveryRecordsDTO) {
        Integer pageSize = compSaleDeliveryRecordsDTO.getPageSize();
        Integer page = compSaleDeliveryRecordsDTO.getPage();
        if (pageSize > 0 && page > 0) {
            PageHelper.startPage(page, pageSize);
        }
        List<CompSaleDeliveryRecordsDTO> compSaleDeliveryRecordsDTOList =
                baseDao.getSaleDeliveryRecordsPageList(compSaleDeliveryRecordsDTO.getCompId(), compSaleDeliveryRecordsDTO.getParam());
        return  new PageInfo<>(compSaleDeliveryRecordsDTOList);
    }

}
